namespace CSharpPro._0928;

public class Work3
{
    public void flower()
    {
        //一位数
        Console.WriteLine("一位："+1);
        //两位数
        Console.Write("两位：");
        for (int i = 10; i < 100; i++)
        {
            int a, b;
            a = i % 10;
            b = i / 10;
            if (a * a * a + b * b * b == i)
            {
                Console.Write(i+" ");
            }
        }
        Console.WriteLine("");
        //三位数
        Console.Write("三位：");
        for (int i = 100; i < 1000; i++)
        {
            int a, b,c;
            a = i / 100; //百位 1
            b = i % 10;  //个位 3
            c = (i-a*100-b)/10;  //十位 
            if (a * a * a + b * b * b + c * c * c == i)
            {
                Console.Write(i + " ");
            }
        }
        Console.WriteLine("");
    } 
}